package com.banyuan.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

    public static Date StringToDate(String birthday,String pattern) {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        Date parse = null;
        try {
            parse = sdf.parse(birthday);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return parse;
    }
    public static Date StringToDate(String birthday) {
        String pattern = "yyyy-MM-dd";
        Date date = StringToDate(birthday, pattern);
        return date;
    }



}
